<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<title></title>
	<js file="__STATIC__/hdjs/jquery-1.7.2.min.js"/>
	<css file="__STATIC__/hdjs/hdjs.css"/>
	<js file="__STATIC__/hdjs/hdjs.min.js"/>
</head>
<body>
	
	<div class="hd-menu-list">
	    <ul>
	        <li class="active"><a href="{|U:'Flink/index'}">友链列表</a></li>
	        <li><a href="{|U:'Flink/add'}">添加友链</a></li>

	    </ul>
	</div>
	<form action="{|U:'Flink/add'}" method="post">
		<table class="hd-table hd-table-list">
		    <thead>
		    <tr>
		    	<td>选择</td>
		        <td>FID</td>
		        <td>友链名</td>
		        <td>链接</td>		        
		        <td>添加时间</td>
		        <td>排序</td>
		        <td>商标图片</td>
		        <td>显示状态</td>
		        <td>友链描述</td>
		        <td>操作</td>
		    </tr>
		    </thead>
		    
			    <tbody>
			    	<list from="$flink" name="$t">
					    <tr>
					    	<td  class="hd-w30 fid"><input type="checkbox" name="fid[]" value="{$t.fid}"></td>
					        <td>{$t.fid}</td>
					        <td class="fname">{$t.fname}</td>
					        <td>{$t.url}</td>
					       
					        <td>{$t.addtime}</td>
					        <td>{$t.sort}</td>
					        <td>{$t.logo}</td>
					        <td>{$t.is_show}</td>
							 <td>{$t.msg}</td>
					        <td class="hd-w100">
					            <a href="{|U:'Flink/edit',array('fid'=>$t['fid'])}">修改</a> |
					            <a href="{|U:'Flink/add',array('fid'=>$t['fid'])}">添加</a> |
					            <a href="{|U:'Flink/del',array('fid'=>$t['fid'])}">删除</a>
					        </td>
					    </tr>
					</list>
			    </tbody>
		</table>
	<input type="submit" value="修改">
	</form>
	<script type="text/javascript">
		$(function(){
			$('.fid').click(function(){
				chose = $(this).attr('chose');
				// alert(chose);
				if(!chose){
					$(this).attr('chose','1');
					value =$(this).parents('tr').eq(0).find('.fname').html();
					value = value.trim();

					str = "<input type='text' name='fname[]' value='"+value+"' />";

					$(this).parents('tr').eq(0).find('.fname').html(str);
				}else{
					$(this).removeAttr('chose');
					fname = $(this).parents('tr').eq(0).find('.fname').find('input').val();
					$(this).parents('tr').eq(0).find('.fname').html(fname);
				}
				
				
			})
		})
	</script>	
</body>
</html>